# -*- encoding = utf-8 -*-
import requests
import urllib.parse
import json
import pprint
header = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36'
}
form_data = {
    'name' : 'Python',
    'publisher' : '清华大学出版社'
}

cookies = dict(uuid='999888')

# res = requests.post('http://127.0.0.1:8008/oto/setCookies/', data = form_data, headers=header)
# res = requests.get('http://127.0.0.1:8008/oto/getCookies/', headers=header, cookies=cookies)
# print(res.content)
# print(res.cookies)
# res.cookies
# res = requests.get('http://127.0.0.1:8008/oto/getCookies/', headers=header, cookies=res.cookies)
# print(res.content)
# print(res.cookies)


# res = requests.get('http://127.0.0.1:8008/oto/setSession/', headers=header)

# cookies = dict(sessionid='iwf0lq7t0yzrr49g6dcu0dtuirh6gl7z')
data = {"sessionid" : "i0is7u64727jcayv2a1ado8q7w0rnk0f"}
res = requests.get('http://127.0.0.1:8008/note/getnotes/?query=1', cookies = data)

a = json.loads(res.content.decode())

# print(res.content.decode())
pprint.pprint(a)
print(res.cookies)